import {Alert, AlertProps} from "@mui/material";
import {FC, ReactNode} from "react";
import DGGrowView from "./DGGrowView.tsx";

interface DGAlertTextProps extends AlertProps {
    children?: ReactNode,
    time?: number;
    animation?: boolean;
}

const DGAlertText: FC<DGAlertTextProps> = ({children, animation, time, ...other}) => {
    return (<>
        {animation && <DGGrowView time={time}><Alert {...other}>{children}</Alert></DGGrowView>}
        {!animation && <Alert {...other}>{children}</Alert>}
    </>);
}
export default DGAlertText